package cn.singno.springBoot.demo.ch08_event;

import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;

@Component
public class DemoListener implements ApplicationListener<DemoEvent>
{
        public void onApplicationEvent(DemoEvent event)
        {
		String msg = event.getMsg();
		
		try
                {
	                Thread.sleep(1000);
                } catch (InterruptedException e)
                {
	                e.printStackTrace();
                }
		System.out.println("我(bean-demoListener)收到了bean-demoPublisher发布的消息：" + msg);
        }
}
